﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityStandardAssets.Characters.FirstPerson;

public class ButtonManager : MonoBehaviour
{
    public static ButtonManager instance;
    public GameObject settingPanel;
    public GameObject ZhuyePanel;
    public GameObject EndPanel;
    public GameObject CF2Panel;
    public GameObject bofang;
    public GameObject speed;
    //按钮添加
    public GameObject privacypanel;
    public GameObject yinsibtn;
    public GameObject morebtn;
    public GameObject quitbtn;
    public GameObject addiconbtn;

    private void Awake()
    {
        instance = this;
    }

    private void Start()
    {
        AdManager.Instance.AddBtn(yinsibtn,morebtn,quitbtn,addiconbtn);
    }

    public void Hide()
    {
        AdManager.Instance.Hide(privacypanel);
    }
    public void More()
    {
        AdManager.Instance.MoreGame();
    }
    public void Quit()
    {
        AdManager.Instance.Quit();
    }
    public void AddIconBtn()
    {
        AdManager.Instance.AddDesktopIcon();
    }

    public void StartGame()
    {
        CF2Panel.SetActive(true);
        settingPanel.SetActive(false);
        ZhuyePanel.SetActive(false);
        bofang.SetActive(true);
        speed.SetActive(true);
    }
    public void SettingOpen()
    {
        AdManager.Instance.ShowNative(0);
        settingPanel.SetActive(true);
    }

    public void BackToGame()
    {
        settingPanel.SetActive(false);
    }

    public void BackToMenuscene()
    {
        bofang.SetActive(false);
        speed.SetActive(false);
        EndPanel.SetActive(false);
        ZhuyePanel.SetActive(true);
        SceneManager.LoadScene("farma");
    }

    public void BackToMenu()
    {
        bofang.SetActive(false);
        speed.SetActive(false);
        EndPanel.SetActive(false);
        ZhuyePanel.SetActive(true);
        SceneManager.LoadScene("farma");
    }

    public void LowSspeed()
    {
        FirstPersonController.Instance.m_WalkSpeed = 15f;
    }

    public void HighSspeed()
    {
        FirstPersonController.Instance.m_WalkSpeed = 40f;
    }
}
